Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add battery health info #102

Merged
merged 11 commits into from
Apr 21, 2023
Merged

add battery health info #102

merged 11 commits into from
Apr 21, 2023

Conversation

pkowalsk1
Copy link
Contributor

@pkowalsk1 pkowalsk1 commented Apr 5, 2023

bump::patch

The capability to publish battery health information in the BatteryState message has been implemented.

@pkowalsk1 pkowalsk1 changed the title add health info add battery health info Apr 5, 2023
@pkowalsk1 pkowalsk1 requested review from Kotochleb and KmakD and removed request for KmakD April 6, 2023 09:03
panther_battery/src/adc_node.py Outdated Show resolved Hide resolved
panther_battery/src/adc_node.py Outdated Show resolved Hide resolved
panther_battery/src/roboteq_republisher_node.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Kotochleb Kotochleb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason I feel like POWER_SUPPLY_HEALTH_DEAD and POWER_SUPPLY_HEALTH_OVERHEAT could yield logfatal instead of logerr, but this would look worse in code

panther_battery/src/adc_node.py Outdated Show resolved Hide resolved
panther_battery/src/adc_node.py Outdated Show resolved Hide resolved
pkowalsk1 and others added 2 commits April 18, 2023 21:32
Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>
@pkowalsk1
Copy link
Contributor Author

For some reason I feel like POWER_SUPPLY_HEALTH_DEAD and POWER_SUPPLY_HEALTH_OVERHEAT could yield logfatal instead of logerr, but this would look worse in code

Our products never encounter fatal errors ;)

Comment on lines 105 to 108
self._battery_voltage_mean += (
-self._battery_voltage_hist[0] / self._volt_mean_length
+ new_val / self._volt_mean_length
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This node could have the comment as well

@Kotochleb Kotochleb merged commit 7724a64 into ros1 Apr 21, 2023
@Kotochleb Kotochleb deleted the add-bat-health-info branch April 21, 2023 11:56
rafal-gorecki added a commit that referenced this pull request Jun 12, 2023
* Light dimmer (#105)

* Light dimmer

* Update

* delete debug

* add brake

* fix

* formated

* battery_animation 3 stage

* fix

* add david suggestion

* Update panther_lights/src/animation/battery_animation.py

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

---------

Co-authored-by: aayli <altair1x2@gmail.com>
Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* add battery health info (#102)

* add health info

* Update README.md

* add logs

* add voltage mean count

* update republisher node

* fix typo

* Update panther_battery/src/adc_node.py

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update adc_node.py

* Update roboteq_republisher_node.py

* fix typo

---------

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>
Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update changelog

* 1.0.1

* fix bug (#112)

* fix bug

* Pawel sugestions

---------

Co-authored-by: aayli <altair1x2@gmail.com>

* Update changelog

* 1.0.2

* Ros1 motor enable srv (#113)

* add motors enable srv

* add reseting can callback times

* disable motors if script reset fails

* working solution

* fix

* IO initial state pth1.05

* remove unneccessary method

* fix type

* update README

* Update panther_power_control/README.md

Co-authored-by: Paweł Kowalski <82044322+pkowalsk1@users.noreply.github.com>

* review changes

---------

Co-authored-by: Paweł Kowalski <82044322+pkowalsk1@users.noreply.github.com>

* Update changelog

* 1.0.3

* Thread lock (#110)

* thread lock

* undo fcn naming

* few more lock

* revert nodes

* Paweł suggestions

* change

* e_stop

---------

Co-authored-by: aayli <altair1x2@gmail.com>

* Update changelog

* 1.0.4

* APA102 cpp implementation (#108)

* Use CPP for APA102

* Add color correction

* Utilise gpiod

* Remove ::

* Fix lights after tests

* Fix default pin number

* Add set brightness service

* Invert LED_SBC_SEL pin

* Change SPI mode

* Change clock polarity

* Reduce number of ROS lgger instances

* Celan up code, update to libgpiod 2.0

* Update panther_lights/include/panther_lights/apa102.hpp

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Update panther_lights/src/lights_driver_node.cpp

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Update panther_lights/src/lights_driver_node.cpp

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Update panther_lights/include/panther_lights/apa102.hpp

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Review changes

* Update panther_lights/src/apa102.cpp

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Review cleanup

* Add build dependencies

* FIx launchfile

* Update panther_lights/CMakeLists.txt

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Update panther_lights/CMakeLists.txt

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Update panther_lights/src/apa102.cpp

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Update panther_lights/src/driver_node.cpp

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Update panther_lights/src/driver_node.cpp

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Review changes

* Fix inlude order

* Fix references and APA102 constructor

* Add build dependencies for libgpiod v2

* Bring back libgpiod v1

---------

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Update changelog

* 1.0.5

* Rviz lights plugin (#111)

* basic plugin usage - POC

* add rear animation texture

* fix rviz config

* fix .rviz file

* Update changelog

* 1.0.6

* check can err (#119)

* Update changelog

* 1.0.7

* update bt project and launch files

* remove scheduler_node

* fix queuing

* remove old variable

---------

Co-authored-by: rafal-gorecki <126687345+rafal-gorecki@users.noreply.github.com>
Co-authored-by: aayli <altair1x2@gmail.com>
Co-authored-by: Paweł Kowalski <82044322+pkowalsk1@users.noreply.github.com>
Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>
Co-authored-by: action-bot <action-bot@action-bot.com>
Kotochleb added a commit that referenced this pull request Jul 25, 2023
* BT manager node draft (#100)

* BT manager node draft

* rename package | add AsyncSpinner

* update package version

* ROS 1 manager bt add basic plugins (#101)

* add basic ROS service plugins

* improve logging and naming

* Ros1 manager bt create basic trees (#104)

* create basic trees and update plugins

* update README | small fixes

* change shutdown nodes to stateful

* change param naming

* fix shutdown hosts node

* small fixes

* Update panther_manager/include/panther_manager/moving_average.hpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/include/panther_manager/moving_average.hpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/include/panther_manager/plugins/action/shutdown_hosts_from_file_node.hpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/include/panther_manager/shutdown_host_node.hpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/src/manager_bt_node.cpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/src/manager_bt_node.cpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/README.md

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/config/PantherManagerBT.xml

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/config/PantherManagerBT.xml

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/config/PantherManagerBT.xml

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/src/manager_bt_node.cpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* review fixes

* move nh | change set up tree method

* Update panther_manager/src/manager_bt_node.cpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/src/manager_bt_node.cpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/src/manager_bt_node.cpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/src/manager_bt_node.cpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/src/manager_bt_node.cpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/src/manager_bt_node.cpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/include/panther_manager/plugins/action/call_trigger_service_node.hpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/plugins/action/call_trigger_service_node.cpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/include/panther_manager/plugins/action/call_set_led_animation_service_node.hpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/include/panther_manager/plugins/ros_service_node.hpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* review changes

* moving average initial value

* Update panther_manager/include/panther_manager/plugins/ros_service_node.hpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* use bat percent average

* update includes | unify sleep

* review fixes

* README draft

* moving average unique ptr

* Update panther_manager/include/panther_manager/manager_bt_node.hpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/include/panther_manager/manager_bt_node.hpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/plugins/action/call_set_led_animation_service_node.cpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/plugins/action/call_trigger_service_node.cpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/include/panther_manager/moving_average.hpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* review fixes

* fix moving avg | review fixes

---------

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* ros plugin | pass nh by reference (#116)

* ros plugin | pass nh by reference

* formating

* Ros1 manager bt signal shutdown (#117)

* add SignalShutdown node

* name type

* review fixes

* revert output port

* Ros1 bt shutdown nodes (#114)

* new shutdown structure

* small fixes

* remove old file

* small fix

* review fixes

* move Host class

* add fsm to ShutdownHost

* hosts list as shared_ptr

* change remove duplicates method

* remove shutdown_timeout bb entry

* Update panther_manager/include/panther_manager/plugins/shutdown_hosts_node.hpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/include/panther_manager/plugins/shutdown_host.hpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update panther_manager/include/panther_manager/plugins/shutdown_hosts_node.hpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* review fixes

* Update panther_manager/include/panther_manager/plugins/shutdown_host.hpp

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* change ssh_execute_command

* fix

---------

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* update shutdown nodes (#120)

* update shutdown nodes

* review fixes

* review fix

* Ros1 manager bt update (#121)

* Light dimmer (#105)

* Light dimmer

* Update

* delete debug

* add brake

* fix

* formated

* battery_animation 3 stage

* fix

* add david suggestion

* Update panther_lights/src/animation/battery_animation.py

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

---------

Co-authored-by: aayli <altair1x2@gmail.com>
Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* add battery health info (#102)

* add health info

* Update README.md

* add logs

* add voltage mean count

* update republisher node

* fix typo

* Update panther_battery/src/adc_node.py

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update adc_node.py

* Update roboteq_republisher_node.py

* fix typo

---------

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>
Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>

* Update changelog

* 1.0.1

* fix bug (#112)

* fix bug

* Pawel sugestions

---------

Co-authored-by: aayli <altair1x2@gmail.com>

* Update changelog

* 1.0.2

* Ros1 motor enable srv (#113)

* add motors enable srv

* add reseting can callback times

* disable motors if script reset fails

* working solution

* fix

* IO initial state pth1.05

* remove unneccessary method

* fix type

* update README

* Update panther_power_control/README.md

Co-authored-by: Paweł Kowalski <82044322+pkowalsk1@users.noreply.github.com>

* review changes

---------

Co-authored-by: Paweł Kowalski <82044322+pkowalsk1@users.noreply.github.com>

* Update changelog

* 1.0.3

* Thread lock (#110)

* thread lock

* undo fcn naming

* few more lock

* revert nodes

* Paweł suggestions

* change

* e_stop

---------

Co-authored-by: aayli <altair1x2@gmail.com>

* Update changelog

* 1.0.4

* APA102 cpp implementation (#108)

* Use CPP for APA102

* Add color correction

* Utilise gpiod

* Remove ::

* Fix lights after tests

* Fix default pin number

* Add set brightness service

* Invert LED_SBC_SEL pin

* Change SPI mode

* Change clock polarity

* Reduce number of ROS lgger instances

* Celan up code, update to libgpiod 2.0

* Update panther_lights/include/panther_lights/apa102.hpp

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Update panther_lights/src/lights_driver_node.cpp

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Update panther_lights/src/lights_driver_node.cpp

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Update panther_lights/include/panther_lights/apa102.hpp

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Review changes

* Update panther_lights/src/apa102.cpp

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Review cleanup

* Add build dependencies

* FIx launchfile

* Update panther_lights/CMakeLists.txt

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Update panther_lights/CMakeLists.txt

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Update panther_lights/src/apa102.cpp

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Update panther_lights/src/driver_node.cpp

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Update panther_lights/src/driver_node.cpp

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Review changes

* Fix inlude order

* Fix references and APA102 constructor

* Add build dependencies for libgpiod v2

* Bring back libgpiod v1

---------

Co-authored-by: Dawid Kmak <73443304+KmakD@users.noreply.github.com>

* Update changelog

* 1.0.5

* Rviz lights plugin (#111)

* basic plugin usage - POC

* add rear animation texture

* fix rviz config

* fix .rviz file

* Update changelog

* 1.0.6

* check can err (#119)

* Update changelog

* 1.0.7

* update bt project and launch files

* remove scheduler_node

* fix queuing

* remove old variable

---------

Co-authored-by: rafal-gorecki <126687345+rafal-gorecki@users.noreply.github.com>
Co-authored-by: aayli <altair1x2@gmail.com>
Co-authored-by: Paweł Kowalski <82044322+pkowalsk1@users.noreply.github.com>
Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>
Co-authored-by: action-bot <action-bot@action-bot.com>

* ROS 1 manager bt dosc (#126)

* update docs

* update docs

* ad medyfying bt section

* update lights tree png

* update README

* Update panther_manager/README.md

Co-authored-by: Paweł Kowalski <82044322+pkowalsk1@users.noreply.github.com>

* Update panther_manager/README.md

Co-authored-by: Paweł Kowalski <82044322+pkowalsk1@users.noreply.github.com>

* Update panther_manager/README.md

Co-authored-by: Paweł Kowalski <82044322+pkowalsk1@users.noreply.github.com>

* Update panther_manager/README.md

Co-authored-by: Paweł Kowalski <82044322+pkowalsk1@users.noreply.github.com>

* Update panther_manager/README.md

Co-authored-by: Paweł Kowalski <82044322+pkowalsk1@users.noreply.github.com>

* Update panther_manager/README.md

Co-authored-by: Paweł Kowalski <82044322+pkowalsk1@users.noreply.github.com>

* review fixes

---------

Co-authored-by: Paweł Kowalski <82044322+pkowalsk1@users.noreply.github.com>

* add battery health check (#141)

* add battery health check

* update readme

* fix typo

* fix args

* Ros1 update bt images (#143)

* add battery health check

* update readme

* fix typo

* fix args

* update README imgs

* update README

* merge fix

* Update fan on/off thresholds (#146)

* install BT from rosdep

* fix rosdep install

* fix manager linking

---------

Co-authored-by: Krzysztof Wojciechowski <49921081+Kotochleb@users.noreply.github.com>
Co-authored-by: rafal-gorecki <126687345+rafal-gorecki@users.noreply.github.com>
Co-authored-by: aayli <altair1x2@gmail.com>
Co-authored-by: Paweł Kowalski <82044322+pkowalsk1@users.noreply.github.com>
Co-authored-by: action-bot <action-bot@action-bot.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants